package com.ldp.designpatterns.study.builder;

import com.ldp.designpatterns.study.builder.abstractBuilder.HouseBuilder;
import com.ldp.designpatterns.study.builder.concreteBuilder.ConcreteHouseBuilder;
import com.ldp.designpatterns.study.builder.concreteBuilder.LuxuryHouseBuilder;
import com.ldp.designpatterns.study.builder.director.Director;
import com.ldp.designpatterns.study.builder.product.House;

/**
 * @ClassName BuilderTest
 * @Description TODO 这个示例演示了如何使用建造者模式创建不同类型的房屋，每种房屋类型的建造过程都由相应的具体建造者类负责实现，而指导者类负责协调建造过程。
 * @Author lindipei
 * @Date 2023/10/17 15:25
 */
public class BuilderTest {
    public static void main(String[] args) {
        HouseBuilder concreteBuilder = new ConcreteHouseBuilder();
        Director director1 = new Director(concreteBuilder);
        House concreteHouse = director1.constructHouse();
        System.out.println("Concrete House: " + concreteHouse);

        HouseBuilder luxuryBuilder = new LuxuryHouseBuilder();
        Director director2 = new Director(luxuryBuilder);
        House luxuryHouse = director2.constructHouse();
        System.out.println("Luxury House: " + luxuryHouse);
    }
}
